package day02_homework;

import java.util.Scanner;

public class Test01_1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名：");
        String inputName = sc.nextLine();
        if (inputName.matches("[a-zA-Z0-9_]{3,15}")) {
            System.out.println("请输入年龄：");
            String inputAge = sc.nextLine();
            int age = Integer.parseInt(inputAge);
            if (age >= 0 && age <= 100) {
                System.out.println("注册成功！！！");
            } else {
                System.out.println("年龄有误！！！");
            }
        } else {
            System.out.println("用户名有误！！！");
        }
    }
}
